@layout('layouts/page')

@section('content')

<div id="menuTree" class="twelve columns panel form">
{{ Form::open('admin/menu', 'POST') }}
	<ul class="disc accordion">
		@foreach ($navigation as $controller => $action)
			@if(empty($action))
				<li >
					<div class="title">
						<input type="text" name="{{$controller}}[arr]" value="{{ isset($selected[$controller])?$selected[$controller]['arrangement']:''}}" style="width:20px;box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);background:none repeat scroll 0 0 rgba(0, 0, 0, 0.2);color:#fff">
						{{Str::upper($controller)}}
						{{Form::hidden($controller.'[id]',isset($selected[$controller])?$selected[$controller]['id']:0);}}
						<span class="">
							<label class="checkbox" for="{{$controller}}[alias]">
			                 	 Screen Name :<input type="text" name="{{$controller}}[alias]" value="{{ isset($selected[$controller])?$selected[$controller]['alias']:''}}">
			                </label>
							<label class="checkbox" for="{{$controller}}[header]">
			                    Header:<input type="checkbox" name="{{$controller}}[header]" {{ isset($selected[$controller])?$selected[$controller]['header']:''}} id="{{$controller}}[header]" > 
			                </label>
							<label class="checkbox" for="{{$controller}}[footer]">
			                    Footer:<input type="checkbox" name="{{$controller}}[footer]" {{ isset($selected[$controller])?$selected[$controller]['footer']:''}} id="{{$controller}}[footer]" > 
			                </label>
							<label class="checkbox" for="{{$controller}}[auth]">
			                    Auth:<input type="checkbox" name="{{$controller}}[auth]"  {{ isset($selected[$controller])?$selected[$controller]['auth']:''}} id="{{$controller}}[auth]" > 
			                </label>
						</span>
					</div>
				</li>
			@else
				<li class="{{ isset($selected[$controller])? 'active':''}}">
					<div class="title" >
						<input type="text" name="{{$controller}}[arr]" value="{{ isset($selected[$controller])?$selected[$controller]['arrangement']:''}}" style="width:20px;box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);background:none repeat scroll 0 0 rgba(0, 0, 0, 0.2);color:#fff">
						{{Str::upper($controller)}}
						{{Form::hidden($controller.'[id]',isset($selected[$controller])?$selected[$controller]['id']:0);}}
						<span class="">
							<label class="checkbox" for="{{$controller}}[alias]">
			                 	 Screen Name :<input type="text" name="{{$controller}}[alias]" value="{{ isset($selected[$controller])?$selected[$controller]['alias']:''}}">
			                </label>
							<label class="checkbox" for="{{$controller}}[header]">
			                    Header:<input type="checkbox" name="{{$controller}}[header]" {{ isset($selected[$controller])?$selected[$controller]['header']:''}} id="{{$controller}}[header]" > 
			                </label>
							<label class="checkbox" for="{{$controller}}[footer]">
			                    Footer:<input type="checkbox" name="{{$controller}}[footer]" {{ isset($selected[$controller])?$selected[$controller]['footer']:''}} id="{{$controller}}[footer]" > 
			                </label>
							<label class="checkbox" for="{{$controller}}[auth]">
			                    Auth:<input type="checkbox" name="{{$controller}}[auth]"  {{ isset($selected[$controller])?$selected[$controller]['auth']:''}} id="{{$controller}}[auth]" > 
			                </label>
							<label class="checkbox" for="{{$controller}}[admin]">
			                    Admin Only:<input type="checkbox" name="{{$controller}}[admin]"  {{ isset($selected[$controller])?$selected[$controller]['admin']:''}} id="{{$controller}}[admin]" > 
			                </label>
						</span>
					</div>
					<div class="content">
						<ul class="no-bullet" >
							@foreach ($action as $page)
								<li >
									<input type="text" name="{{$controller}}[{{$page['page']}}][arr]" value="{{ isset($selected[$controller][$page['page']])?$selected[$controller][$page['page']]['arrangement']:''}}" style="width:20px;box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);background:none repeat scroll 0 0 rgba(218, 207, 110, 0.2);">
									{{Str::title($page['page'])}}&nbsp;&nbsp;<em>{{'{'.Str::lower($page['path']).'}'}}</em>
									{{Form::hidden($controller.'['.$page['page'].']'.'[id]',isset($selected[$controller][$page['page']])?$selected[$controller][$page['page']]['id']:0);}}
									<span class="">
										<label class="checkbox" for="{{$controller}}[{{$page['page']}}][alias]">
						                 	 Screen Name :<input type="text" name="{{$controller}}[{{$page['page']}}][alias]" value="{{ isset($selected[$controller][$page['page']])?$selected[$controller][$page['page']]['alias']:''}}">
						                </label>
										<label class="checkbox" for="{{$controller}}[{{$page['page']}}][header]">
						                    Header:<input type="checkbox" name="{{$controller}}[{{$page['page']}}][header]" {{isset($selected[$controller][$page['page']])?$selected[$controller][$page['page']]['header']:''}} id="{{$controller}}[{{$page['page']}}][header]" > 
						                </label>
										<label class="checkbox" for="{{$controller}}[{{$page['page']}}][footer]">
						                    Footer:<input type="checkbox" name="{{$controller}}[{{$page['page']}}][footer]" {{isset($selected[$controller][$page['page']])?$selected[$controller][$page['page']]['footer']:''}} id="{{$controller}}[{{$page['page']}}][footer]" > 
						                </label>
										<label class="checkbox" for="{{$controller}}[{{$page['page']}}][auth]">
						                    Auth:<input type="checkbox" name="{{$controller}}[{{$page['page']}}][auth]" {{isset($selected[$controller][$page['page']])?$selected[$controller][$page['page']]['auth']:''}} id="{{$controller}}[{{$page['page']}}][auth]" >
						                </label>
										<!-- <label class="checkbox" for="{{$controller}}[{{$page['page']}}][icon]">
						                    Icon:<input type="checkbox" name="{{$controller}}[{{$page['page']}}][icon]" id="{{$controller}}[{{$page['page']}}][icon]" > 
						                    {{Form::select($controller.'['.$page['page'].']'.'[icon]', $pageExist)}}
						                </label> -->
									</span>
								</li>
							@endforeach
						</ul>
					</div>
				</li>
			@endif
		@endforeach
	</ul>
	{{ Form::submit('SIMPAN')}}
{{ Form::close()}}
<!-- <pre/>{{var_dump($pageExist)}} -->
</div>



@endsection